//
//  MacroConfig.h
//  IntegralWall
//
//  Created by 小焘无量 on 2022/8/12.
//

#ifndef MacroConfig_h
#define MacroConfig_h


// 设置Dlog可以打印出类名,方法名,行数.
#ifdef DEBUG
#define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
#define DLog(...)
#endif

#define WeakSelf      __weak __typeof(self) weakSelf = self;
#define StrongSelf    __strong __typeof(self) strongSelf = weakSelf;

#define FormatString(format,...)  [NSString stringWithFormat:format,##__VA_ARGS__]

#define ImageWithName(name) [UIImage imageNamed:name]
#define kWindow [[UIApplication sharedApplication].windows lastObject]


//颜色宏
#define kRGB(rgbValue) [UIColor yt_colorWithRGB:rgbValue]
#define kRGBA(rgbValue, floatValue) [UIColor yt_colorWithRGB:rgbValue alpha:floatValue]

// 主题色
#define kThemeColor [UIColor yt_colorWithRGB:0x6AA94E]
// 普通文字颜色
#define kNormalColor [UIColor yt_colorWithRGB:0x888888]
// 导航栏文字颜色
#define kNavTitleColor [UIColor yt_colorWithRGB:0xffffff]
// sectionHeader 颜色
#define kSeactionHeaderColor [UIColor yt_colorWithRGB:0xF3F3F3]
// 系统绿色 颜色
#define kGreenColor [UIColor yt_colorWithRGB:0x3AAF67]
// 系统红色 颜色
#define kRedColor [UIColor yt_colorWithRGB:0xFF2424]





#define StatusBarHeight        NSObject.statusBarHeight
#define IsIPhoneX              NSObject.isIphoneX
#define NavigationBarHeight    NSObject.naviBarHeight
#define TabBarHeight           NSObject.tabBarHeight
#define HomeIndecatorHeight    NSObject.homeIndecatorHeight

#define kSizeToFit(arg) (arg * NSObject.screenScale)


#define ScreenSize      [UIScreen mainScreen].bounds.size
#define ScreenWidth     (ScreenSize.width)
#define ScreenHeight    (ScreenSize.height)
#define ScreenCenter    CGPointMake(ScreenWidth/2.0, ScreenHeight/2.0)

#define SCALEWidth(w)       (ScreenWidth / 375.0 * (CGFloat)w)
#define SCALEHeight(h)      (ScreenHeight / 668.0 * (CGFloat)h)

#define SCALE(f)            (ScreenWidth / 375.0 * (CGFloat)f)

/// 字符串是否为空
#define IsEmptyString(string) ((string == nil || string == NULL || [string isKindOfClass:[NSNull class]] || [string isEqualToString:@"(null)"] || [string isEqualToString:@""] || [[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] length] == 0) ? YES : NO)


#endif /* MacroConfig_h */
